-
Notifications
You must be signed in to change notification settings - Fork 569
Beta release workflow #3131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beta release workflow #3131
Conversation
* improve faucet erroring * update history * fix tests * fix history
* update depandabot frequency * change freq to monthly
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.28.5 to 0.28.15. - [Release notes](https://github.com/TypeStrong/TypeDoc/releases) - [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md) - [Commits](TypeStrong/typedoc@v0.28.5...v0.28.15) --- updated-dependencies: - dependency-name: typedoc dependency-version: 0.28.15 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…as Optional (XRPLF#3153) * Mark AssetsAvailable, AssetsTotal and LossUnrealized of Vault object as optional
* WIP commit * WIP commit * WIP commit * add LoanBrokerSet transaction * update definitions.json * update history * add LoanBrokerCoverDeposit * add LoanBrokerCoverWithdraw * add LoanBrokerCoverClawback * add LoanSet transaction * add loan transactions * WIP commit * WIP commit * WIP commit * fix models * WIP commit * WIP commit * WIP commit * WIP commit * WIP commit * WIP commit * WIP commit * WIP commit * fix types * fix autofill for VaultCreate * implement autofill for LoanSet * WIP commit * Mark AssetsAvailable, AssetsTotal and LossUnrealized of Vault object as optional * Update HISTORY.md * assert objects in test cases * test autofill for LoanSet tx * improve warning message * change to console.warn * address codarabbit suggestions * add unit test for encodeForMultisigning with SigningPubKey present * address code-review comments and LoanSet autofill default * add conditions on flags * address codarabbit suggestions * enable PermissionDelegationV1_1 --------- Co-authored-by: Kuan Lin <[email protected]>
update package version Co-authored-by: Raj Patel <[email protected]>
update package version Co-authored-by: Raj Patel <[email protected]>
Bumps [expect](https://github.com/jestjs/jest/tree/HEAD/packages/expect) from 29.7.0 to 30.2.0. - [Release notes](https://github.com/jestjs/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jestjs/jest/commits/v30.2.0/packages/expect) --- updated-dependencies: - dependency-name: expect dependency-version: 30.2.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
update the lerna version
Bumps [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) from 9.35.0 to 9.39.2. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/commits/v9.39.2/packages/js) --- updated-dependencies: - dependency-name: "@eslint/js" dependency-version: 9.39.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.17.20 to 4.17.21. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash) --- updated-dependencies: - dependency-name: "@types/lodash" dependency-version: 4.17.21 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [webpack](https://github.com/webpack/webpack) from 5.102.0 to 5.104.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md) - [Commits](webpack/webpack@v5.102.0...v5.104.1) --- updated-dependencies: - dependency-name: webpack dependency-version: 5.104.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 29.4.1 to 29.4.6. - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](kulshekhar/ts-jest@v29.4.1...v29.4.6) --- updated-dependencies: - dependency-name: ts-jest dependency-version: 29.4.6 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…3143) Bumps [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) from 17.21.3 to 17.23.1. - [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases) - [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md) - [Commits](eslint-community/eslint-plugin-n@v17.21.3...v17.23.1) --- updated-dependencies: - dependency-name: eslint-plugin-n dependency-version: 17.23.1 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…3173) * build(deps-dev): bump typescript-eslint from 8.39.0 to 8.52.0 Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 8.39.0 to 8.52.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.52.0/packages/typescript-eslint) --- updated-dependencies: - dependency-name: typescript-eslint dependency-version: 8.52.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps-dev): bump typescript-eslint from 8.39.0 to 8.52.0 (XRPLF#3181) * Initial plan * Initial plan for fixing typescript-eslint linting issues Co-authored-by: mvadari <[email protected]> * Fix typescript-eslint linting issues from 8.52.0 upgrade Co-authored-by: mvadari <[email protected]> * Disable import/no-unresolved for isomorphic test files using module subpaths Co-authored-by: mvadari <[email protected]> * Fix st-number.ts logic and revert import/no-unresolved disable Co-authored-by: mvadari <[email protected]> * Update typescript-eslint version in package.json to 8.52.0 Co-authored-by: mvadari <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mvadari <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: mvadari <[email protected]> Co-authored-by: Mayukha Vadari <[email protected]>
…RPLF#3171) Bumps [webpack-bundle-analyzer](https://github.com/webpack/webpack-bundle-analyzer) from 4.10.2 to 5.1.0. - [Changelog](https://github.com/webpack/webpack-bundle-analyzer/blob/main/CHANGELOG.md) - [Commits](webpack/webpack-bundle-analyzer@v4.10.2...v5.1.0) --- updated-dependencies: - dependency-name: webpack-bundle-analyzer dependency-version: 5.1.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ws](https://github.com/websockets/ws) from 8.18.3 to 8.19.0. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](websockets/ws@8.18.3...8.19.0) --- updated-dependencies: - dependency-name: ws dependency-version: 8.19.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [eslint](https://github.com/eslint/eslint) from 9.35.0 to 9.39.2. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](eslint/eslint@v9.35.0...v9.39.2) --- updated-dependencies: - dependency-name: eslint dependency-version: 9.39.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [jest-mock](https://github.com/jestjs/jest/tree/HEAD/packages/jest-mock) from 29.7.0 to 30.2.0. - [Release notes](https://github.com/jestjs/jest/releases) - [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jestjs/jest/commits/v30.2.0/packages/jest-mock) --- updated-dependencies: - dependency-name: jest-mock dependency-version: 30.2.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
8e1ec3f to
c77b2df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/xrpl/test/integration/transactions/singleAssetVault.test.ts (1)
436-441: Inconsistent handling: Missing nullish coalescing.Line 438 accesses
afterDepositVault.AssetsTotaldirectly without the?? '0'fallback, unlike other occurrences in this file. SinceAssetsTotalis optional in theVaultmodel, this could cause the test to fail if the field is undefined.Suggested fix
assert.equal( - afterDepositVault.AssetsTotal, + afterDepositVault.AssetsTotal ?? '0', depositAmount, 'Vault should reflect deposited assets', )
🤖 Fix all issues with AI agents
In `@packages/ripple-binary-codec/HISTORY.md`:
- Around line 3-5: The changelog currently has an empty "## Unreleased" heading
immediately above "## 2.6.0", causing ambiguity; either remove the empty "##
Unreleased" heading if 2.6.0 is already released, or move the "## 2.6.0
(2025-12-16)" entry and its contents under the "## Unreleased" heading (and
rename when releasing) so the file contains only one clear active section;
update the headings accordingly by editing the "## Unreleased" and "## 2.6.0"
lines to reflect the correct release status.
In `@packages/xrpl/src/models/transactions/index.ts`:
- Around line 57-69: Reorder the transaction exports so they are alphabetical:
move the LoanBroker* exports to the correct positions by exporting
LoanBrokerCoverClawback, LoanBrokerCoverDeposit, LoanBrokerCoverWithdraw,
LoanBrokerDelete, LoanBrokerSet before LoanDelete, then export LoanDelete,
LoanManage (with LoanManageFlags and LoanManageFlagsInterface), LoanPay, and
finally LoanSet (with LoanSetFlags and LoanSetFlagsInterface); adjust only the
export order in the index.ts to match these symbols.
In `@packages/xrpl/src/models/transactions/loanManage.ts`:
- Around line 86-96: When converting object-form flags to bitmask in the
loanManage transaction, the code handles txFlags.tfLoanImpair and
txFlags.tfLoanUnimpair but omits txFlags.tfLoanDefault; update the
object-to-bitmask branch to check for txFlags.tfLoanDefault and, if true, OR in
LoanManageFlags.tfLoanDefault so that tfLoanDefault behaves equivalently whether
txFlags is a number or an object (references: txFlags, tfLoanDefault,
LoanManageFlags.tfLoanDefault, LoanManageFlags.tfLoanImpair,
LoanManageFlags.tfLoanUnimpair).
In `@packages/xrpl/src/models/transactions/loanSet.ts`:
- Around line 127-145: The CounterpartySignature validation currently only
checks isRecord; update the validator for CounterpartySignature to also
type-check optional SigningPubKey and TxnSignature as strings when present and,
if Signers exists, ensure it's an array whose items are validated with isSigner
(same pattern used in validateBaseTransaction). Locate the CounterpartySignature
check and replace/augment the isRecord-only validation with explicit checks for
SigningPubKey (string), TxnSignature (string), and iterate Signers to call
isSigner on each element, returning a clear failure if any inner check fails.
In `@packages/xrpl/test/integration/transactions/lendingProtocol.test.ts`:
- Line 5: Replace the direct source import of the sign function from
'ripple-keypairs/src' with the package entry point 'ripple-keypairs'; update the
import that currently references 'sign' so it imports from 'ripple-keypairs'
instead, ensuring you use the public package API rather than the internal /src
path (look for the import statement that brings in the sign symbol).
♻️ Duplicate comments (1)
.github/workflows/faucet_test.yml (1)
22-22: Job condition preventsworkflow_callfrom skipping faucet tests.This issue was already flagged in a previous review. The condition
github.event_name != 'workflow_dispatch'evaluates totrueforworkflow_callevents, causing the OR to short-circuit and ignoreinputs.run_faucet_tests. As previously suggested, change to:- if: ${{ github.event_name != 'workflow_dispatch' || inputs.run_faucet_tests != false }} + if: ${{ github.event_name != 'workflow_call' || inputs.run_faucet_tests != false }}
🧹 Nitpick comments (9)
packages/ripple-binary-codec/src/types/st-number.ts (1)
198-200: Redundant optional chaining.The
?.inb?.lengthis unnecessary here. The preceding!bcheck already short-circuits whenbis falsy, so by the timeb.lengthis evaluated,bis guaranteed to be truthy. The original!b || b.length !== 12was already safe.The change is harmless but adds noise. Consider reverting to the original form for clarity:
- if (!b || b?.length !== 12) + if (!b || b.length !== 12)packages/xrpl/test/client/autofill.test.ts (1)
590-593: Clarify the fee calculation comment to explain the signer count relationship.The comment correctly reflects the calculation but lacks clarity about what the "3" represents. Since the fee is derived from the counterparty's signer count, the comment should explicitly state this relationship:
Suggested change
- // base_fee + 3 * base_fee + // Fee = base_fee * (1 + counterPartySignersCount) = 12 * 4 = 48packages/xrpl/src/models/transactions/common.ts (1)
354-371: Consider renaming for consistency with other type guards.The function
validateHexMetadatareturns a boolean type guard but uses thevalidate*naming convention. Othervalidate*functions in this file (e.g.,validateRequiredField,validateOptionalField) throwValidationErrorinstead of returning boolean.Consider renaming to
isValidHexMetadataorisHexMetadatato align with theis*naming pattern used by other type guards in this file (e.g.,isAmount,isAccount,isLedgerEntryId).♻️ Suggested rename
-export function validateHexMetadata( +export function isHexMetadata( input: unknown, lengthUpto: number, ): input is string {packages/xrpl/test/models/loanBrokerSet.test.ts (1)
72-78: Consider adding boundary test for negative ManagementFeeRate.The test only covers values exceeding the maximum (123324). Consider adding a test case for negative values (e.g.,
-1) to ensure the lower bound validation works correctly.💡 Suggested test addition
test('incorrect ManagementFeeRate', () => { tx.ManagementFeeRate = 123324 assertInvalid( tx, 'LoanBrokerSet: ManagementFeeRate must be between 0 and 10000 inclusive', ) + + tx.ManagementFeeRate = -1 + assertInvalid( + tx, + 'LoanBrokerSet: ManagementFeeRate must be between 0 and 10000 inclusive', + ) })packages/xrpl/src/models/transactions/loanBrokerCoverClawback.ts (1)
59-61: Consider adding a type guard before accessing.value.While the code works correctly at runtime (since
isTokenAmountensures the shape), accessingtx.Amount.valueon aRecord<string, unknown>relies on implicit type coercion. This follows existing patterns in the codebase, but for clarity, you could cast after the null check:const amount = tx.Amount as IssuedCurrencyAmount | MPTAmount if (new BigNumber(amount.value).isLessThan(0)) { ... }This is a minor readability improvement—the current approach is functionally correct.
packages/xrpl/test/models/loanBrokerCoverClawback.test.ts (1)
38-47: Consider adding a test for negative Amount values.The validator enforces
Amount >= 0(seeloanBrokerCoverClawback.tslines 59-61), but there's no test case covering this validation path. Adding a test would ensure the negative value check is exercised:test('negative Amount', () => { tx.Amount = { mpt_issuance_id: '0000012FFD9EE5DA93AC614B4DB94D7E0FCE415CA51BED47', value: '-1000', } assertInvalid(tx, 'LoanBrokerCoverClawback: Amount must be >= 0') })packages/xrpl/src/sugar/autofill.ts (1)
287-295: Consider adding error handling for the ledger_entry response.If the
LoanBrokerIDdoesn't correspond to a validLoanBrokerledger entry (e.g., wrong entry type or non-existent), the cast on line 293 could lead to unexpected behavior when accessing.Owner.🔧 Suggested improvement
const resp = ( await client.request({ command: 'ledger_entry', index: tx.LoanBrokerID, ledger_index: 'validated', } as LedgerEntryRequest) ).result.node as LoanBroker + + if (resp?.LedgerEntryType !== 'LoanBroker') { + throw new ValidationError( + `LoanBrokerID does not reference a valid LoanBroker ledger entry`, + ) + } counterParty = resp.Ownerpackages/xrpl/src/models/transactions/loanSet.ts (2)
193-195: Consider adding minimum value validation forPaymentTotaland standaloneGracePeriod.
PaymentTotalis validated only as a number (line 193), but a value of 0 or negative may not be meaningful for a loan. Similarly,GracePeriod(line 195) is only validated in relation toPaymentInterval, but there's no standalone check for non-negative values.♻️ Suggested additions
if (tx.PaymentInterval != null && tx.PaymentInterval < MIN_PAYMENT_INTERVAL) { throw new ValidationError( `LoanSet: PaymentInterval must be greater than or equal to ${MIN_PAYMENT_INTERVAL}`, ) } + if (tx.PaymentTotal != null && tx.PaymentTotal <= 0) { + throw new ValidationError( + `LoanSet: PaymentTotal must be greater than 0`, + ) + } + + if (tx.GracePeriod != null && tx.GracePeriod < 0) { + throw new ValidationError( + `LoanSet: GracePeriod must be greater than or equal to 0`, + ) + } + if ( tx.PaymentInterval != null && tx.GracePeriod != null && tx.GracePeriod > tx.PaymentInterval ) {
209-253: Optional: Consider extracting rate validation into a helper.The five rate field validations follow an identical pattern. A helper function could reduce duplication while maintaining clarity.
♻️ Example helper approach
function validateRateField( tx: Record<string, unknown>, field: string, maxValue: number, ): void { const value = tx[field] if (value != null && (value < 0 || value > maxValue)) { throw new ValidationError( `LoanSet: ${field} must be between 0 and ${maxValue} inclusive`, ) } } // Usage: validateRateField(tx, 'OverpaymentFee', MAX_OVER_PAYMENT_FEE_RATE) validateRateField(tx, 'InterestRate', MAX_INTEREST_RATE) // ... etc
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (62)
.ci-config/rippled.cfg.github/dependabot.yml.github/workflows/faucet_test.yml.github/workflows/nodejs.ymllerna.jsonpackage.jsonpackages/ripple-binary-codec/HISTORY.mdpackages/ripple-binary-codec/package.jsonpackages/ripple-binary-codec/src/enums/definitions.jsonpackages/ripple-binary-codec/src/index.tspackages/ripple-binary-codec/src/types/hash-128.tspackages/ripple-binary-codec/src/types/hash-160.tspackages/ripple-binary-codec/src/types/hash-192.tspackages/ripple-binary-codec/src/types/st-number.tspackages/ripple-binary-codec/test/definitions.test.tspackages/ripple-binary-codec/test/signing-data-encoding.test.tspackages/ripple-binary-codec/tools/generateDefinitions.jspackages/xrpl/HISTORY.mdpackages/xrpl/package.jsonpackages/xrpl/src/Wallet/authorizeChannel.tspackages/xrpl/src/Wallet/batchSigner.tspackages/xrpl/src/Wallet/fundWallet.tspackages/xrpl/src/Wallet/index.tspackages/xrpl/src/index.tspackages/xrpl/src/models/ledger/LedgerEntry.tspackages/xrpl/src/models/ledger/Loan.tspackages/xrpl/src/models/ledger/LoanBroker.tspackages/xrpl/src/models/ledger/Vault.tspackages/xrpl/src/models/ledger/index.tspackages/xrpl/src/models/methods/vaultInfo.tspackages/xrpl/src/models/transactions/common.tspackages/xrpl/src/models/transactions/index.tspackages/xrpl/src/models/transactions/loanBrokerCoverClawback.tspackages/xrpl/src/models/transactions/loanBrokerCoverDeposit.tspackages/xrpl/src/models/transactions/loanBrokerCoverWithdraw.tspackages/xrpl/src/models/transactions/loanBrokerDelete.tspackages/xrpl/src/models/transactions/loanBrokerSet.tspackages/xrpl/src/models/transactions/loanDelete.tspackages/xrpl/src/models/transactions/loanManage.tspackages/xrpl/src/models/transactions/loanPay.tspackages/xrpl/src/models/transactions/loanSet.tspackages/xrpl/src/models/transactions/transaction.tspackages/xrpl/src/models/utils/flags.tspackages/xrpl/src/sugar/autofill.tspackages/xrpl/src/utils/hashes/index.tspackages/xrpl/src/utils/hashes/ledgerSpaces.tspackages/xrpl/src/utils/index.tspackages/xrpl/test/client/autofill.test.tspackages/xrpl/test/connection.test.tspackages/xrpl/test/faucet/fundWallet.test.tspackages/xrpl/test/integration/requests/vaultInfo.test.tspackages/xrpl/test/integration/transactions/delegateSet.test.tspackages/xrpl/test/integration/transactions/lendingProtocol.test.tspackages/xrpl/test/integration/transactions/singleAssetVault.test.tspackages/xrpl/test/models/loanBrokerCoverClawback.test.tspackages/xrpl/test/models/loanBrokerCoverDeposit.test.tspackages/xrpl/test/models/loanBrokerCoverWithdraw.test.tspackages/xrpl/test/models/loanBrokerDelete.test.tspackages/xrpl/test/models/loanBrokerSet.test.tspackages/xrpl/test/models/loanManage.test.tspackages/xrpl/test/setupClient.tspackages/xrpl/test/utils/hashes.test.ts
✅ Files skipped from review due to trivial changes (2)
- packages/xrpl/src/Wallet/batchSigner.ts
- packages/ripple-binary-codec/src/types/hash-160.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/nodejs.yml
🧰 Additional context used
🧠 Learnings (27)
📚 Learning: 2025-01-08T13:08:52.688Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2873
File: packages/xrpl/src/models/transactions/trustSet.ts:33-36
Timestamp: 2025-01-08T13:08:52.688Z
Learning: For trust-set transactions in XRPL, validation rules for flags should be implemented comprehensively rather than cherry-picking specific rules, as there are many interdependent validation rules associated with these flags.
Applied to files:
packages/xrpl/src/models/utils/flags.tspackages/xrpl/src/models/transactions/loanManage.tspackages/xrpl/src/models/transactions/loanSet.ts
📚 Learning: 2025-09-16T05:00:20.420Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 3081
File: packages/xrpl/src/models/transactions/MPTokenIssuanceCreate.ts:57-64
Timestamp: 2025-09-16T05:00:20.420Z
Learning: In XRPL's MPTokenIssuanceCreate flags, the tfMPTCanMutate* flags intentionally use the same bit values as their corresponding base flags (e.g., tfMPTCanMutateCanLock = 0x00000002 matches tfMPTCanLock = 0x00000002) because they operate in different contexts - base flags go in the Flags field while mutable flags go in the MutableFlags field. This design avoids ambiguity since the flags are applied to separate bit fields.
Applied to files:
packages/xrpl/src/models/utils/flags.ts
📚 Learning: 2024-12-06T19:25:15.376Z
Learnt from: shawnxie999
Repo: XRPLF/xrpl.js PR: 2661
File: packages/xrpl/test/integration/transactions/mptokenAuthorize.test.ts:29-118
Timestamp: 2024-12-06T19:25:15.376Z
Learning: In the XRPLF/xrpl.js TypeScript client library, when writing tests (e.g., in `packages/xrpl/test/integration/transactions/`), we generally do not need to test rippled server behaviors, because those behaviors are covered by rippled's own integration and unit tests.
Applied to files:
packages/ripple-binary-codec/test/definitions.test.tspackages/xrpl/test/models/loanBrokerCoverWithdraw.test.tspackages/xrpl/test/models/loanBrokerCoverDeposit.test.tspackages/ripple-binary-codec/src/index.tspackages/xrpl/test/models/loanManage.test.tspackages/xrpl/test/integration/transactions/singleAssetVault.test.tspackages/xrpl/package.jsonpackages/xrpl/test/models/loanBrokerCoverClawback.test.tspackages/xrpl/src/sugar/autofill.tspackages/xrpl/test/client/autofill.test.tspackages/xrpl/src/models/transactions/index.tspackages/xrpl/test/integration/transactions/delegateSet.test.tspackages/xrpl/test/faucet/fundWallet.test.tspackages/ripple-binary-codec/test/signing-data-encoding.test.tspackages/xrpl/test/setupClient.tspackages/xrpl/src/models/transactions/transaction.tspackages/xrpl/test/models/loanBrokerSet.test.tspackages/xrpl/test/integration/transactions/lendingProtocol.test.tspackages/xrpl/test/models/loanBrokerDelete.test.tspackages/xrpl/src/models/transactions/common.tspackages/xrpl/test/connection.test.ts
📚 Learning: 2024-12-06T18:44:55.095Z
Learnt from: shawnxie999
Repo: XRPLF/xrpl.js PR: 2661
File: packages/xrpl/test/models/MPTokenAuthorize.test.ts:60-71
Timestamp: 2024-12-06T18:44:55.095Z
Learning: In the XRPL.js library's TypeScript test file `packages/xrpl/test/models/MPTokenAuthorize.test.ts`, negative test cases for invalid `Account` address format, invalid `Holder` address format, invalid `MPTokenIssuanceID` format, and invalid flag combinations are not necessary.
Applied to files:
packages/ripple-binary-codec/test/definitions.test.tspackages/xrpl/src/models/ledger/Vault.tspackages/xrpl/test/models/loanBrokerCoverWithdraw.test.tspackages/xrpl/test/models/loanBrokerCoverDeposit.test.tspackages/xrpl/test/models/loanManage.test.tspackages/xrpl/test/integration/transactions/singleAssetVault.test.tspackages/xrpl/test/models/loanBrokerCoverClawback.test.tspackages/xrpl/test/client/autofill.test.tspackages/xrpl/test/integration/transactions/delegateSet.test.tspackages/xrpl/test/faucet/fundWallet.test.tspackages/ripple-binary-codec/test/signing-data-encoding.test.tspackages/xrpl/test/models/loanBrokerSet.test.tspackages/xrpl/test/integration/transactions/lendingProtocol.test.tspackages/xrpl/test/models/loanBrokerDelete.test.tspackages/xrpl/src/models/transactions/common.tspackages/xrpl/test/integration/requests/vaultInfo.test.ts
📚 Learning: 2024-12-05T16:48:12.951Z
Learnt from: achowdhry-ripple
Repo: XRPLF/xrpl.js PR: 2661
File: packages/xrpl/src/models/transactions/MPTokenIssuanceCreate.ts:69-102
Timestamp: 2024-12-05T16:48:12.951Z
Learning: When adding validation in `validate*` functions in `packages/xrpl/src/models/transactions/`, utilize existing helper functions (e.g., `validateOptionalField`, `validateType`, `isNumber`, `isInteger`) for type checking and validation where appropriate.
Applied to files:
packages/xrpl/src/models/transactions/loanDelete.tspackages/xrpl/src/models/transactions/loanPay.tspackages/xrpl/test/models/loanBrokerCoverDeposit.test.tspackages/xrpl/src/models/transactions/loanBrokerCoverWithdraw.tspackages/xrpl/src/models/transactions/loanManage.tspackages/xrpl/src/models/transactions/loanBrokerCoverDeposit.tspackages/xrpl/src/models/transactions/transaction.tspackages/xrpl/src/models/transactions/common.tspackages/xrpl/src/models/transactions/loanBrokerSet.tspackages/xrpl/src/models/transactions/loanBrokerCoverClawback.ts
📚 Learning: 2024-12-09T07:06:47.258Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2829
File: packages/xrpl/src/models/ledger/Credential.ts:36-36
Timestamp: 2024-12-09T07:06:47.258Z
Learning: In TypeScript interfaces, ensure that fields documented as optional are marked with the `?` operator to denote optionality.
Applied to files:
packages/xrpl/src/models/ledger/Vault.tspackages/ripple-binary-codec/src/types/hash-128.tspackages/ripple-binary-codec/src/types/hash-192.ts
📚 Learning: 2024-12-06T19:27:11.147Z
Learnt from: shawnxie999
Repo: XRPLF/xrpl.js PR: 2661
File: packages/xrpl/test/integration/transactions/clawback.test.ts:165-178
Timestamp: 2024-12-06T19:27:11.147Z
Learning: In the integration tests for `clawback.test.ts`, it's acceptable to use `ts-expect-error` to bypass type checking when verifying ledger entries, and no additional type safety improvements are needed.
Applied to files:
packages/xrpl/src/models/ledger/Vault.tspackages/xrpl/test/models/loanBrokerCoverWithdraw.test.tspackages/xrpl/src/models/ledger/LedgerEntry.tspackages/xrpl/test/models/loanBrokerCoverDeposit.test.tspackages/xrpl/test/models/loanManage.test.tspackages/xrpl/test/integration/transactions/singleAssetVault.test.tspackages/xrpl/test/models/loanBrokerCoverClawback.test.tspackages/xrpl/test/client/autofill.test.tspackages/xrpl/test/integration/transactions/delegateSet.test.tspackages/xrpl/test/faucet/fundWallet.test.tspackages/ripple-binary-codec/test/signing-data-encoding.test.tspackages/xrpl/test/models/loanBrokerSet.test.tspackages/xrpl/test/integration/transactions/lendingProtocol.test.tspackages/xrpl/test/models/loanBrokerDelete.test.tspackages/xrpl/src/models/transactions/common.tspackages/xrpl/test/integration/requests/vaultInfo.test.tspackages/xrpl/src/models/transactions/loanBrokerCoverClawback.tspackages/xrpl/test/utils/hashes.test.tspackages/xrpl/test/connection.test.ts
📚 Learning: 2024-10-02T15:47:02.491Z
Learnt from: mvadari
Repo: XRPLF/xrpl.js PR: 2690
File: packages/xrpl/tools/generateModels.js:52-52
Timestamp: 2024-10-02T15:47:02.491Z
Learning: In `generateModels.js`, the regex used to match `SubmittableTransaction` in `transaction.ts` is expected to always succeed because the pattern is present in the source code. If it fails, the code needs to be updated.
Applied to files:
packages/xrpl/test/models/loanBrokerCoverWithdraw.test.tspackages/xrpl/src/models/transactions/loanPay.tspackages/xrpl/test/models/loanBrokerCoverDeposit.test.tspackages/xrpl/src/models/transactions/loanBrokerCoverWithdraw.tspackages/xrpl/test/models/loanBrokerCoverClawback.test.tspackages/xrpl/src/models/transactions/transaction.tspackages/xrpl/test/models/loanBrokerSet.test.tspackages/ripple-binary-codec/tools/generateDefinitions.jspackages/xrpl/test/models/loanBrokerDelete.test.tspackages/xrpl/src/models/transactions/common.ts
📚 Learning: 2025-02-12T23:28:55.377Z
Learnt from: mvadari
Repo: XRPLF/xrpl.js PR: 2895
File: packages/xrpl/test/models/clawback.test.ts:0-0
Timestamp: 2025-02-12T23:28:55.377Z
Learning: The `validate` function in xrpl.js is synchronous and should be tested using `assert.doesNotThrow` rather than async assertions.
Applied to files:
packages/xrpl/test/models/loanBrokerCoverWithdraw.test.tspackages/xrpl/test/models/loanBrokerCoverClawback.test.tspackages/xrpl/test/faucet/fundWallet.test.tspackages/xrpl/test/models/loanBrokerDelete.test.tspackages/xrpl/test/connection.test.ts
📚 Learning: 2025-02-12T23:30:40.622Z
Learnt from: mvadari
Repo: XRPLF/xrpl.js PR: 2895
File: packages/xrpl/test/models/DIDDelete.test.ts:28-31
Timestamp: 2025-02-12T23:30:40.622Z
Learning: In JavaScript/TypeScript transaction validation tests, object key validation can be performed using:
1. Object.keys() comparison with expected set
2. TypeScript interfaces with strict object literal checks
3. Object sanitization by filtering to allowed keys only
Applied to files:
packages/xrpl/test/models/loanBrokerCoverWithdraw.test.tspackages/xrpl/test/models/loanBrokerCoverDeposit.test.tspackages/xrpl/test/models/loanBrokerCoverClawback.test.tspackages/xrpl/test/models/loanBrokerSet.test.tspackages/xrpl/test/models/loanBrokerDelete.test.tspackages/xrpl/src/models/transactions/common.ts
📚 Learning: 2024-10-30T01:05:33.583Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2812
File: packages/xrpl/test/integration/transactions/payment.test.ts:41-43
Timestamp: 2024-10-30T01:05:33.583Z
Learning: In tests involving fee calculations for XRPL, avoid using default fee amounts. If unable to retrieve fee values from the latest validated ledger, throw an error instead of defaulting to a specific amount.
Applied to files:
.ci-config/rippled.cfgpackages/xrpl/test/integration/transactions/singleAssetVault.test.tspackages/xrpl/test/client/autofill.test.tspackages/xrpl/test/integration/requests/vaultInfo.test.ts
📚 Learning: 2025-01-08T02:12:28.489Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2874
File: packages/xrpl/test/integration/transactions/permissionedDomain.test.ts:25-80
Timestamp: 2025-01-08T02:12:28.489Z
Learning: For PermissionedDomain feature (XLS-80d), complex error cases like invalid credential format, duplicate credentials, and non-existent DomainID are tested in the rippled C++ implementation rather than being duplicated across SDK implementations like xrpl.js.
Applied to files:
.ci-config/rippled.cfg
📚 Learning: 2024-09-26T21:14:56.813Z
Learnt from: mvadari
Repo: XRPLF/xrpl.js PR: 2788
File: .github/workflows/nodejs.yml:25-25
Timestamp: 2024-09-26T21:14:56.813Z
Learning: In `.github/workflows/nodejs.yml`, the `build-and-lint` job's actions `actions/setup-node` and `actions/cache` are updated to `v4`.
Applied to files:
package.json
📚 Learning: 2025-10-28T14:16:24.585Z
Learnt from: Patel-Raj11
Repo: XRPLF/xrpl.js PR: 3117
File: packages/xrpl/src/models/transactions/common.ts:1133-1180
Timestamp: 2025-10-28T14:16:24.585Z
Learning: The MPTokenMetadata TypeScript interface in xrpl.js reflects the XLS-89 standard (long-form fields only) to provide correct type hints for IDEs and TypeScript users, even though JavaScript users may provide non-standard structures with compact fields or both forms present. This design provides proper tooling support while maintaining runtime flexibility.
Applied to files:
packages/xrpl/src/models/ledger/LoanBroker.tspackages/xrpl/src/models/transactions/common.ts
📚 Learning: 2025-10-30T12:09:55.784Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 3081
File: packages/xrpl/src/models/transactions/MPTokenIssuanceCreate.ts:298-298
Timestamp: 2025-10-30T12:09:55.784Z
Learning: In XRPL's MPTokenIssuanceCreate transaction validation, MaximumAmount must be greater than 0 (not greater than or equal to). The rippled C++ implementation at MPTokenIssuanceCreate.cpp explicitly rejects MaximumAmount == 0 with temMALFORMED, so the JavaScript validation should use `<= 0` to match this behavior.
Applied to files:
packages/xrpl/test/models/loanBrokerCoverDeposit.test.tspackages/xrpl/test/integration/transactions/singleAssetVault.test.tspackages/xrpl/src/models/transactions/common.tspackages/xrpl/src/models/transactions/loanBrokerCoverClawback.ts
📚 Learning: 2025-04-16T15:55:50.121Z
Learnt from: mvadari
Repo: XRPLF/xrpl.js PR: 2801
File: packages/xrpl/src/Wallet/batchSigner.ts:0-0
Timestamp: 2025-04-16T15:55:50.121Z
Learning: When using `encodeForSigningBatch` for Batch transactions in the XRPL.js library, the field names should use camelCase (`flags`, `txIDs`) even though the transaction object properties themselves use PascalCase (`Flags`, `TxIDs`).
Applied to files:
packages/xrpl/src/utils/index.tspackages/ripple-binary-codec/test/signing-data-encoding.test.ts
📚 Learning: 2025-12-16T21:30:24.487Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 3156
File: package.json:51-51
Timestamp: 2025-12-16T21:30:24.487Z
Learning: In the xrpl.js repository, lerna v8 is intentionally used (not v9) as it suffices for resolving security vulnerabilities. The team plans to consider v9 at a later date.
Applied to files:
packages/xrpl/package.json
📚 Learning: 2025-01-08T02:12:28.489Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2874
File: packages/xrpl/test/integration/transactions/permissionedDomain.test.ts:25-80
Timestamp: 2025-01-08T02:12:28.489Z
Learning: The rippled C++ implementation (PR `#5161`) includes comprehensive test coverage for PermissionedDomain (XLS-80d) error cases. The JS SDK tests focus on the happy path since the error cases are already validated at the rippled level, following the principle of not duplicating complex validation testing across SDK implementations.
Applied to files:
packages/xrpl/test/models/loanBrokerCoverClawback.test.tspackages/ripple-binary-codec/test/signing-data-encoding.test.ts
📚 Learning: 2025-01-31T17:46:25.375Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2873
File: packages/xrpl/test/integration/transactions/trustSet.test.ts:0-0
Timestamp: 2025-01-31T17:46:25.375Z
Learning: For the XRPL implementation, extensive test cases for deep freeze behavior (high/low side interactions, clearing flags, etc.) are maintained in the C++ implementation and don't need to be duplicated in the JavaScript implementation.
Applied to files:
packages/xrpl/test/integration/transactions/delegateSet.test.tspackages/xrpl/test/faucet/fundWallet.test.tspackages/xrpl/test/connection.test.ts
📚 Learning: 2025-01-13T22:38:40.085Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 2826
File: packages/xrpl/tools/generateModels.js:25-25
Timestamp: 2025-01-13T22:38:40.085Z
Learning: When parsing rippled source files (e.g., macro files, cpp files) in tools/scripts, extensive error handling for regex matches is not needed as any malformed content would be caught by rippled's C++ compiler and unit tests during the build process.
Applied to files:
packages/ripple-binary-codec/tools/generateDefinitions.js
📚 Learning: 2025-07-10T22:04:59.994Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 3032
File: packages/xrpl/src/models/transactions/common.ts:689-698
Timestamp: 2025-07-10T22:04:59.994Z
Learning: In the XRPL.js library, the validateDomainID function in `packages/xrpl/src/models/transactions/common.ts` should only validate the length (64 characters) of domain IDs, not hex encoding. The rippled C++ implementation does not enforce any regex check on domain ID values, so additional hex validation is not required in the JS implementation.
Applied to files:
packages/ripple-binary-codec/tools/generateDefinitions.jspackages/xrpl/test/models/loanBrokerDelete.test.tspackages/xrpl/src/models/transactions/common.tspackages/ripple-binary-codec/src/types/st-number.ts
📚 Learning: 2025-02-27T19:08:13.676Z
Learnt from: mvadari
Repo: XRPLF/xrpl.js PR: 2895
File: packages/xrpl/test/models/XChainCreateBridge.test.ts:44-44
Timestamp: 2025-02-27T19:08:13.676Z
Learning: Using `delete` operator in model tests is acceptable as it better represents a field being completely absent, which is the intention in validation tests.
Applied to files:
packages/xrpl/test/models/loanBrokerDelete.test.ts
📚 Learning: 2025-10-28T14:16:24.585Z
Learnt from: Patel-Raj11
Repo: XRPLF/xrpl.js PR: 3117
File: packages/xrpl/src/models/transactions/common.ts:1133-1180
Timestamp: 2025-10-28T14:16:24.585Z
Learning: In xrpl.js MPTokenMetadata handling: encodeMPTokenMetadata and decodeMPTokenMetadata are designed to preserve the original structure of the input, only converting between compact and long forms when a single form is present (not both). If both compact (e.g., 'us') and long (e.g., 'uris') forms exist in the input, both are preserved in the output. This is intentional to avoid modifying the user's data. Validation (validateMPTokenMetadata) separately checks and reports XLS-89 compliance.
Applied to files:
packages/xrpl/src/models/transactions/common.ts
📚 Learning: 2025-06-26T17:25:36.429Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 3027
File: packages/xrpl/src/models/ledger/MPTokenIssuance.ts:13-16
Timestamp: 2025-06-26T17:25:36.429Z
Learning: In the XRPL ecosystem, type choices for amount fields (like `number` vs `string`) in ledger objects such as `LockedAmount` vs `OutstandingAmount` in `MPTokenIssuance` are deliberate design decisions made across multiple products and cannot be changed unilaterally by individual contributors.
Applied to files:
packages/xrpl/src/models/transactions/common.ts
📚 Learning: 2025-07-11T21:22:07.809Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 3032
File: packages/xrpl/src/models/transactions/common.ts:689-698
Timestamp: 2025-07-11T21:22:07.809Z
Learning: Domain ID validation in XRPL.js is handled at the serialization/deserialization layer through Hash types in the ripple-binary-codec package, not at the transaction validation layer. The validateDomainID function only needs to validate length (64 characters) as hex validation occurs when Hash types are constructed during serialization.
Applied to files:
packages/xrpl/src/models/transactions/common.ts
📚 Learning: 2025-04-16T15:22:45.633Z
Learnt from: mvadari
Repo: XRPLF/xrpl.js PR: 2801
File: packages/xrpl/test/models/Batch.test.ts:0-0
Timestamp: 2025-04-16T15:22:45.633Z
Learning: Using `as any` type assertions is acceptable in test files for the XRPL.js project, as strict typing is not required for test code.
Applied to files:
packages/xrpl/src/models/transactions/common.ts
📚 Learning: 2025-10-09T20:16:27.834Z
Learnt from: ckeshava
Repo: XRPLF/xrpl.js PR: 3101
File: .github/workflows/nodejs.yml:220-221
Timestamp: 2025-10-09T20:16:27.834Z
Learning: In `.github/workflows/nodejs.yml`, the `generate-documentation` job intentionally uses `if: startsWith(github.ref, 'refs/tags/xrpl@')` instead of `env.GIT_REF` to ensure documentation is only generated and deployed on actual tag push events, not when the workflow is called via `workflow_call` with a tag reference.
Applied to files:
.github/workflows/faucet_test.yml
🧬 Code graph analysis (14)
packages/xrpl/src/models/utils/flags.ts (1)
packages/xrpl/src/models/transactions/index.ts (1)
LoanManageFlags(66-66)
packages/xrpl/test/models/loanBrokerCoverWithdraw.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
assertTxIsValid(66-69)assertTxValidationError(78-85)packages/xrpl/src/models/transactions/loanBrokerCoverWithdraw.ts (1)
validateLoanBrokerCoverWithdraw(46-60)
packages/xrpl/src/models/transactions/loanPay.ts (4)
packages/xrpl/src/models/transactions/index.ts (2)
LoanPay(69-69)BaseTransaction(2-2)packages/xrpl/src/models/transactions/common.ts (6)
BaseTransaction(462-537)validateBaseTransaction(548-613)validateRequiredField(387-413)isString(106-108)isAmount(297-303)isLedgerEntryId(350-352)packages/xrpl/src/models/common/index.ts (1)
MPTAmount(27-30)packages/xrpl/src/errors.ts (1)
ValidationError(156-156)
packages/xrpl/src/models/ledger/LedgerEntry.ts (3)
packages/xrpl/src/models/ledger/Loan.ts (1)
Loan(10-134)packages/xrpl/src/models/ledger/index.ts (2)
Loan(64-64)LoanBroker(66-66)packages/xrpl/src/models/ledger/LoanBroker.ts (1)
LoanBroker(10-84)
packages/xrpl/src/models/ledger/LoanBroker.ts (3)
packages/xrpl/src/models/ledger/index.ts (1)
LoanBroker(66-66)packages/xrpl/src/models/ledger/BaseLedgerEntry.ts (2)
BaseLedgerEntry(1-3)HasPreviousTxnID(5-16)packages/xrpl/src/models/transactions/common.ts (2)
Account(267-267)XRPLNumber(276-276)
packages/xrpl/test/models/loanBrokerCoverDeposit.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
assertTxIsValid(66-69)assertTxValidationError(78-85)packages/xrpl/src/models/transactions/loanBrokerCoverDeposit.ts (1)
validateLoanBrokerCoverDeposit(38-51)
packages/xrpl/test/integration/transactions/singleAssetVault.test.ts (1)
packages/xrpl/src/models/ledger/Vault.ts (1)
Vault(11-83)
packages/xrpl/test/setupClient.ts (1)
packages/xrpl/src/client/index.ts (2)
ClientOptions(102-121)Client(1230-1230)
packages/xrpl/test/models/loanBrokerSet.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
assertTxIsValid(66-69)assertTxValidationError(78-85)packages/xrpl/src/models/transactions/loanBrokerSet.ts (1)
validateLoanBrokerSet(76-152)
packages/xrpl/test/models/loanBrokerDelete.test.ts (2)
packages/xrpl/test/testUtils.ts (2)
assertTxIsValid(66-69)assertTxValidationError(78-85)packages/xrpl/src/models/transactions/loanBrokerDelete.ts (1)
validateLoanBrokerDelete(31-41)
packages/xrpl/src/models/transactions/common.ts (2)
packages/xrpl/src/models/common/index.ts (2)
IssuedCurrencyAmount(23-25)MPTAmount(27-30)packages/xrpl/src/models/utils/index.ts (1)
isHex(60-62)
packages/xrpl/src/models/transactions/loanBrokerSet.ts (3)
packages/xrpl/src/models/transactions/index.ts (2)
LoanBrokerSet(57-57)BaseTransaction(2-2)packages/xrpl/src/models/transactions/common.ts (10)
BaseTransaction(462-537)XRPLNumber(276-276)validateBaseTransaction(548-613)validateRequiredField(387-413)isString(106-108)validateOptionalField(427-447)isNumber(116-118)isXRPLNumber(155-162)isLedgerEntryId(350-352)validateHexMetadata(361-371)packages/xrpl/src/errors.ts (1)
ValidationError(156-156)
packages/xrpl/src/models/transactions/loanBrokerCoverClawback.ts (2)
packages/xrpl/src/models/transactions/common.ts (6)
BaseTransaction(462-537)validateBaseTransaction(548-613)validateOptionalField(427-447)isString(106-108)isTokenAmount(311-315)isLedgerEntryId(350-352)packages/xrpl/src/models/common/index.ts (2)
IssuedCurrencyAmount(23-25)MPTAmount(27-30)
packages/xrpl/test/connection.test.ts (1)
packages/xrpl/src/client/RequestManager.ts (1)
resolve(59-73)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: browser (24.x)
- GitHub Check: unit (22.x)
- GitHub Check: Analyze (javascript)
- GitHub Check: integration (22.x)
- GitHub Check: build-and-lint (24.x)
- GitHub Check: integration (24.x)
- GitHub Check: unit (24.x)
- GitHub Check: integration (20.x)
- GitHub Check: unit (20.x)
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| "expect": "^30.2.0", | ||
| "jest": "^29.3.1", | ||
| "jest-mock": "^29.3.1", | ||
| "lerna": "^4.0.0", | ||
| "jest-mock": "^30.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Jest 30 expect jest-mock compatibility with Jest 29
💡 Result:
Short answer: Mostly yes — Jest 30's expect and jest-mock are compatible with code that used Jest 29, but there are a few breaking changes you must address (matchers, mock helpers and TypeScript types).
Key changes to watch for
- Alias matchers removed (older alias names were deleted; use primary matcher names). [1]
- Legacy jest.genMockFromModule was removed — use jest.createMockFromModule instead. [1]
- jest-mock type/utility renames: MaybeMocked/MaybeMockedDeep were reorganized/renamed (e.g., Mocked / MockedShallow) and some mock-related TypeScript types (MockFunctionMetadata, SpyInstance) were removed or renamed (use jest.Spied for SpyInstance cases). Also jest.mocked() now deep-mocks by default; pass { shallow: true } to keep the old shallow behavior. [1][2]
- Minimum runtime/TS versions changed (Node >=18 and TypeScript >=5.4 for Jest types). Update environment if needed. [1]
Actionable recommendations
- Search-and-replace removed matcher aliases to their primary names. [1]
- Replace genMockFromModule → createMockFromModule. [1]
- Update any TypeScript annotations that use removed types and adjust jest.mocked(...) calls where you relied on shallow behavior. [1][2]
- Ensure your Node and TypeScript meet Jest 30’s minimums before upgrading. [1]
Sources: Jest v30 upgrade notes and docs. [1] [2]
References
[1] Jest — Upgrading to Jest 30 (Jest docs). (jestjs.io)
[2] Jest v30 notes / jest-mock changes (versioned docs). (fossies.org)
Citations:
- 1: https://jestjs.io/docs/upgrading-to-jest30?utm_source=openai
- 2: https://fossies.org/linux/jest/website/versioned_docs/version-30.0/UpgradingToJest29.md?utm_source=openai
🌐 Web query:
jest-mock package version history and Jest compatibility
💡 Result:
Summary — jest-mock version history & Jest compatibility
- Package source and versions: jest-mock is the standalone npm package used by Jest; it has many published versions (v24 → v30+), with the npm registry showing latest v30.x releases. [1]
- Compatibility rule (practical): jest-mock’s major version tracks Jest’s major release — use the jest-mock release that matches your Jest major (e.g., jest 29 → jest-mock 29.x, jest 30 → jest-mock 30.x). Jest’s upgrade notes call out API/type changes in jest-mock between majors (v28→v29). [2][3]
- Notable changes: type/export changes and helper behavior (e.g., jest.mocked / Mocked* types) occurred in the v28→v29 upgrade; consult the Jest upgrade guide when moving major versions. [2]
- How to pick an exact version: install the jest-mock version matching your installed Jest major (npm i jest-mock@), or let Jest’s own package dependency resolve the appropriate minor/patch. For breaking/type changes, follow the Jest changelog/upgrade docs. [1][2]
Sources
- npm package (jest-mock) — versions and latest release. [1]
- Jest upgrade notes (v28→v29) and docs referencing jest-mock API/type changes. [2][3]
Version mismatch in Jest ecosystem packages requires resolution.
expect and jest-mock are bumped to v30.x while jest remains at ^29.3.1. These packages have tightly coupled versioning with Jest's major releases (jest 29 → jest-mock 29.x, jest 30 → jest-mock 30.x). While some backward compatibility exists, Jest 30 introduces breaking changes including:
- Removed matcher aliases and helper APIs (e.g.,
jest.genMockFromModule) - jest-mock type/utility renames (
Mocked/MockedShallowreplacingMaybeMocked/MaybeMockedDeep) - Behavioral changes in
jest.mocked()(now deep-mocks by default) - Minimum requirements: Node >=18, TypeScript >=5.4
Resolve by either:
- Downgrading
expectandjest-mockto v29.x - Upgrading
jestandts-jestto v30.x (and updating any breaking API usages and type annotations)
| ## Unreleased | ||
|
|
||
| ## 2.6.0 (2025-12-16) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify release status: remove empty "Unreleased" section or move version entry under it.
The empty ## Unreleased section immediately above the versioned ## 2.6.0 section creates ambiguity about the release status. Standard changelog practice is to either:
- Keep changes under
## Unreleaseduntil the release is made, then rename it to the version number, OR - Remove the
## Unreleasedsection once changes are moved to a versioned section
Consider removing line 3 if version 2.6.0 has been released, or moving the version 2.6.0 content under the Unreleased heading if it hasn't.
Suggested fix if the release has been made
-## Unreleased
-
## 2.6.0 (2025-12-16)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## Unreleased | |
| ## 2.6.0 (2025-12-16) | |
| ## 2.6.0 (2025-12-16) |
🤖 Prompt for AI Agents
In `@packages/ripple-binary-codec/HISTORY.md` around lines 3 - 5, The changelog
currently has an empty "## Unreleased" heading immediately above "## 2.6.0",
causing ambiguity; either remove the empty "## Unreleased" heading if 2.6.0 is
already released, or move the "## 2.6.0 (2025-12-16)" entry and its contents
under the "## Unreleased" heading (and rename when releasing) so the file
contains only one clear active section; update the headings accordingly by
editing the "## Unreleased" and "## 2.6.0" lines to reflect the correct release
status.
| [ | ||
| "LoanScale", | ||
| { | ||
| "isSerialized": true, | ||
| "isSigningField": true, | ||
| "isVLEncoded": false, | ||
| "nth": 1, | ||
| "type": "Int32" | ||
| } | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for Int32 type implementation in the binary codec
rg -n "Int32" --type ts packages/ripple-binary-codec/src/Repository: XRPLF/xrpl.js
Length of output: 6869
🏁 Script executed:
#!/bin/bash
# Search for Int32 class definition and exports
rg -n "class Int32|export.*Int32" --type ts packages/ripple-binary-codec/src/types/Repository: XRPLF/xrpl.js
Length of output: 127
🏁 Script executed:
#!/bin/bash
# Search for any Int32 definition in the entire types directory
find packages/ripple-binary-codec/src/types -name "*.ts" | xargs cat | grep -n "Int32" | head -20Repository: XRPLF/xrpl.js
Length of output: 1274
🏁 Script executed:
#!/bin/bash
# Check what types are exported
cat -n packages/ripple-binary-codec/src/types/index.tsRepository: XRPLF/xrpl.js
Length of output: 2145
🏁 Script executed:
#!/bin/bash
# Check the specific line in definitions.json where Int32 is used
sed -n '2483,2492p' packages/ripple-binary-codec/src/enums/definitions.jsonRepository: XRPLF/xrpl.js
Length of output: 238
Add Int32 type codec implementation.
The LoanScale field uses the Int32 type, but no corresponding codec class exists in the binary codec. Only unsigned integer types (UInt8, UInt16, UInt32, UInt64) are currently implemented. Create an Int32 class (similar to UInt32) with proper serialization/deserialization logic using the existing writeInt32BE and readInt32BE utilities, then export it from types/index.ts and register it in the coreTypes map.
| export { LoanBrokerSet } from './loanBrokerSet' | ||
| export { LoanBrokerDelete } from './loanBrokerDelete' | ||
| export { LoanBrokerCoverDeposit } from './loanBrokerCoverDeposit' | ||
| export { LoanBrokerCoverWithdraw } from './loanBrokerCoverWithdraw' | ||
| export { LoanBrokerCoverClawback } from './loanBrokerCoverClawback' | ||
| export { LoanSet, LoanSetFlags, LoanSetFlagsInterface } from './loanSet' | ||
| export { LoanDelete } from './loanDelete' | ||
| export { | ||
| LoanManage, | ||
| LoanManageFlags, | ||
| LoanManageFlagsInterface, | ||
| } from './loanManage' | ||
| export { LoanPay } from './loanPay' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify all referenced loan module files exist
for module in loanBrokerSet loanBrokerDelete loanBrokerCoverDeposit loanBrokerCoverWithdraw loanBrokerCoverClawback loanSet loanDelete loanManage loanPay; do
fd -t f "^${module}.ts$" packages/xrpl/src/models/transactions/
doneRepository: XRPLF/xrpl.js
Length of output: 565
🏁 Script executed:
# Also check the index.ts file to see the exports context
cat -n packages/xrpl/src/models/transactions/index.ts | sed -n '50,75p'Repository: XRPLF/xrpl.js
Length of output: 1262
🏁 Script executed:
# Get more context to see other transaction patterns, especially looking for ones with flags
cat -n packages/xrpl/src/models/transactions/index.ts | head -100 | tail -50Repository: XRPLF/xrpl.js
Length of output: 2208
🏁 Script executed:
# Search for other patterns with Flags to understand the established pattern
rg "Flags.*Interface" packages/xrpl/src/models/transactions/index.ts -A 2 | head -50Repository: XRPLF/xrpl.js
Length of output: 1311
The exports are not in alphabetical order. The LoanBrokerSet, LoanBrokerDelete, and other LoanBroker* entries should come after LoanDelete to maintain alphabetical ordering. The correct order should be: LoanBrokerCoverClawback, LoanBrokerCoverDeposit, LoanBrokerCoverWithdraw, LoanBrokerDelete, LoanBrokerSet, LoanDelete, LoanManage, LoanPay, LoanSet.
The flag exports for LoanSet and LoanManage are correct and consistent with the established pattern throughout the file (only exporting flags when the transaction type supports them).
🤖 Prompt for AI Agents
In `@packages/xrpl/src/models/transactions/index.ts` around lines 57 - 69, Reorder
the transaction exports so they are alphabetical: move the LoanBroker* exports
to the correct positions by exporting LoanBrokerCoverClawback,
LoanBrokerCoverDeposit, LoanBrokerCoverWithdraw, LoanBrokerDelete, LoanBrokerSet
before LoanDelete, then export LoanDelete, LoanManage (with LoanManageFlags and
LoanManageFlagsInterface), LoanPay, and finally LoanSet (with LoanSetFlags and
LoanSetFlagsInterface); adjust only the export order in the index.ts to match
these symbols.
| let flags = 0 | ||
| if (typeof txFlags === 'number') { | ||
| flags = txFlags | ||
| } else { | ||
| if (txFlags.tfLoanImpair) { | ||
| flags |= LoanManageFlags.tfLoanImpair | ||
| } | ||
| if (txFlags.tfLoanUnimpair) { | ||
| flags |= LoanManageFlags.tfLoanUnimpair | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
find . -type f -name "loanManage.ts" | head -5Repository: XRPLF/xrpl.js
Length of output: 110
🏁 Script executed:
wc -l packages/xrpl/src/models/transactions/loanManage.tsRepository: XRPLF/xrpl.js
Length of output: 112
🏁 Script executed:
cat -n packages/xrpl/src/models/transactions/loanManage.tsRepository: XRPLF/xrpl.js
Length of output: 3293
🏁 Script executed:
# Let's look at similar transaction models to understand the flag handling pattern
fd -t f "\.ts$" packages/xrpl/src/models/transactions/ | grep -E "(trustSet|accountSet|nftokenMint)" | head -3Repository: XRPLF/xrpl.js
Length of output: 158
🏁 Script executed:
# Check if there are any validation rules or comments about mutual exclusivity
rg -A 5 -B 5 "tfLoanDefault|tfLoanImpair|tfLoanUnimpair" packages/xrpl/src/Repository: XRPLF/xrpl.js
Length of output: 4132
🏁 Script executed:
# Check trustSet validation for comprehensive flag handling pattern
sed -n '1,150p' packages/xrpl/src/models/transactions/trustSet.ts | grep -A 50 "let flags"Repository: XRPLF/xrpl.js
Length of output: 39
🏁 Script executed:
# Check accountSet for similar flag patterns
sed -n '1,200p' packages/xrpl/src/models/transactions/accountSet.ts | grep -A 50 "let flags"Repository: XRPLF/xrpl.js
Length of output: 39
🏁 Script executed:
# Let's look at trustSet validation more carefully
cat -n packages/xrpl/src/models/transactions/trustSet.ts | head -150Repository: XRPLF/xrpl.js
Length of output: 5747
🏁 Script executed:
# Let's look at accountSet validation
cat -n packages/xrpl/src/models/transactions/accountSet.ts | head -200Repository: XRPLF/xrpl.js
Length of output: 7801
🏁 Script executed:
# Continue reading trustSet validation for flag handling
sed -n '150,250p' packages/xrpl/src/models/transactions/trustSet.tsRepository: XRPLF/xrpl.js
Length of output: 276
🏁 Script executed:
# Continue reading accountSet validation for flag handling
sed -n '200,280p' packages/xrpl/src/models/transactions/accountSet.tsRepository: XRPLF/xrpl.js
Length of output: 969
🏁 Script executed:
# Check if there are other transaction models with similar flag object-to-bitmask conversion
rg "if \(typeof txFlags === 'number'\)" packages/xrpl/src/models/transactions/ -A 10Repository: XRPLF/xrpl.js
Length of output: 869
🏁 Script executed:
# Let's check the MPTokenIssuanceCreate mentioned in the learnings to see the flag pattern
cat -n packages/xrpl/src/models/transactions/MPTokenIssuanceCreate.ts | sed -n '50,120p'Repository: XRPLF/xrpl.js
Length of output: 3540
Add missing tfLoanDefault flag to object-to-bitmask conversion.
When txFlags is an object, the code only processes tfLoanImpair and tfLoanUnimpair, but ignores tfLoanDefault even though it's defined in the enum and interface. If a user passes { tfLoanDefault: true }, the flag is silently ignored, leading to inconsistent behavior between the number and object flag formats.
🔧 Suggested fix
let flags = 0
if (typeof txFlags === 'number') {
flags = txFlags
} else {
+ if (txFlags.tfLoanDefault) {
+ flags |= LoanManageFlags.tfLoanDefault
+ }
if (txFlags.tfLoanImpair) {
flags |= LoanManageFlags.tfLoanImpair
}
if (txFlags.tfLoanUnimpair) {
flags |= LoanManageFlags.tfLoanUnimpair
}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| let flags = 0 | |
| if (typeof txFlags === 'number') { | |
| flags = txFlags | |
| } else { | |
| if (txFlags.tfLoanImpair) { | |
| flags |= LoanManageFlags.tfLoanImpair | |
| } | |
| if (txFlags.tfLoanUnimpair) { | |
| flags |= LoanManageFlags.tfLoanUnimpair | |
| } | |
| } | |
| let flags = 0 | |
| if (typeof txFlags === 'number') { | |
| flags = txFlags | |
| } else { | |
| if (txFlags.tfLoanDefault) { | |
| flags |= LoanManageFlags.tfLoanDefault | |
| } | |
| if (txFlags.tfLoanImpair) { | |
| flags |= LoanManageFlags.tfLoanImpair | |
| } | |
| if (txFlags.tfLoanUnimpair) { | |
| flags |= LoanManageFlags.tfLoanUnimpair | |
| } | |
| } |
🤖 Prompt for AI Agents
In `@packages/xrpl/src/models/transactions/loanManage.ts` around lines 86 - 96,
When converting object-form flags to bitmask in the loanManage transaction, the
code handles txFlags.tfLoanImpair and txFlags.tfLoanUnimpair but omits
txFlags.tfLoanDefault; update the object-to-bitmask branch to check for
txFlags.tfLoanDefault and, if true, OR in LoanManageFlags.tfLoanDefault so that
tfLoanDefault behaves equivalently whether txFlags is a number or an object
(references: txFlags, tfLoanDefault, LoanManageFlags.tfLoanDefault,
LoanManageFlags.tfLoanImpair, LoanManageFlags.tfLoanUnimpair).
| /** | ||
| * An inner object that contains the signature of the Lender over the transaction. | ||
| */ | ||
| export interface CounterpartySignature { | ||
| /** | ||
| * The Public Key to be used to verify the validity of the signature. | ||
| */ | ||
| SigningPubKey?: string | ||
|
|
||
| /** | ||
| * The signature of over all signing fields. | ||
| */ | ||
| TxnSignature?: string | ||
|
|
||
| /** | ||
| * An array of transaction signatures from the Counterparty signers to indicate their approval of this transaction. | ||
| */ | ||
| Signers?: Signer[] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# View the loanSet.ts file around the validation area (line 181)
sed -n '170,190p' packages/xrpl/src/models/transactions/loanSet.tsRepository: XRPLF/xrpl.js
Length of output: 1080
🏁 Script executed:
# Check the full validation function context
sed -n '150,200p' packages/xrpl/src/models/transactions/loanSet.tsRepository: XRPLF/xrpl.js
Length of output: 1919
🏁 Script executed:
# Search for how other Signer[] fields are validated in the codebase
rg -n "Signers\s*\?" packages/xrpl/src/models/transactions/ -A 2 -B 2 | head -50Repository: XRPLF/xrpl.js
Length of output: 1988
🏁 Script executed:
# Check the Signer type definition
rg -n "interface Signer|type Signer" packages/xrpl/src/models/ -A 5 | head -30Repository: XRPLF/xrpl.js
Length of output: 2039
🏁 Script executed:
# Look for validation of Signers in other transaction types
rg -n "validateSigners|Signers.*validate" packages/xrpl/src/models/ -A 3Repository: XRPLF/xrpl.js
Length of output: 39
🏁 Script executed:
# Check BaseTransaction validation
rg -n "validateBaseTransaction" packages/xrpl/src/models/transactions/common.ts -A 50 | head -80Repository: XRPLF/xrpl.js
Length of output: 1713
🏁 Script executed:
# Look for Signers validation in common.ts
rg -n "Signers" packages/xrpl/src/models/transactions/common.ts -B 2 -A 2 | head -60Repository: XRPLF/xrpl.js
Length of output: 715
🏁 Script executed:
# Check how trustSet validates (since it deals with complex flags)
rg -n "validateTrustSet" packages/xrpl/src/models/transactions/trustSet.ts -A 20 | head -40Repository: XRPLF/xrpl.js
Length of output: 784
🏁 Script executed:
# Look for any validation of Signer[] arrays
rg -n "Signer\[" packages/xrpl/src/models/transactions/ -A 5 -B 5 | grep -A 10 -B 10 "validate"Repository: XRPLF/xrpl.js
Length of output: 39
🏁 Script executed:
# Check the isSigner validation function
rg -n "function isSigner|const isSigner|export.*isSigner" packages/xrpl/src/ -A 10 | head -50Repository: XRPLF/xrpl.js
Length of output: 800
🏁 Script executed:
# Check if CounterpartySignature structure is validated anywhere else
rg -n "CounterpartySignature" packages/xrpl/src/ -B 2 -A 2Repository: XRPLF/xrpl.js
Length of output: 1462
🏁 Script executed:
# Look for similar nested object validation patterns (objects with Signers inside)
rg -n "\.Signers\?" packages/xrpl/src/models/transactions/ -B 5 -A 5 | head -80Repository: XRPLF/xrpl.js
Length of output: 39
🏁 Script executed:
# Check the Signer interface definition more closely
sed -n '43,50p' packages/xrpl/src/models/common/index.tsRepository: XRPLF/xrpl.js
Length of output: 172
🏁 Script executed:
# Check the full isSigner implementation to see what it validates
sed -n '60,80p' packages/xrpl/src/models/transactions/common.tsRepository: XRPLF/xrpl.js
Length of output: 481
🏁 Script executed:
# Look for any validation helper for nested objects or arrays
rg -n "validateOptionalField.*Signers|validateRequiredField.*Signers" packages/xrpl/src/models/transactions/ -B 2 -A 2Repository: XRPLF/xrpl.js
Length of output: 1269
🏁 Script executed:
# Check if there's any pattern for validating nested objects with inner Signers
rg -n "forEach.*Signer|\.Signers.*forEach" packages/xrpl/src/models/transactions/ -B 3 -A 5 | head -60Repository: XRPLF/xrpl.js
Length of output: 39
🏁 Script executed:
# Check if there are tests for CounterpartySignature validation
rg -n "CounterpartySignature" packages/ --type ts -A 5 -B 5 | grep -i testRepository: XRPLF/xrpl.js
Length of output: 3655
🏁 Script executed:
# Look for patterns of validating optional nested objects in the codebase
rg -n "validateOptionalField.*isRecord" packages/xrpl/src/models/transactions/ -B 1 -A 3 | head -100Repository: XRPLF/xrpl.js
Length of output: 613
🏁 Script executed:
# Check if there are helper functions for validating optional fields within nested objects
rg -n "function validate.*Field|const validate.*Field" packages/xrpl/src/models/transactions/common.ts -A 10 | head -80Repository: XRPLF/xrpl.js
Length of output: 605
Add validation for CounterpartySignature inner fields.
The CounterpartySignature field is validated only as isRecord (line 181), but inner fields are not validated. If the Signers field is present, each signer should be validated using the isSigner check (following the pattern in validateBaseTransaction). Additionally, SigningPubKey and TxnSignature should be validated as strings when present.
Consider adding comprehensive validation for the inner structure:
- Validate
Signersarray elements usingisSigner - Type-check
SigningPubKeyandTxnSignatureas strings if provided
🤖 Prompt for AI Agents
In `@packages/xrpl/src/models/transactions/loanSet.ts` around lines 127 - 145, The
CounterpartySignature validation currently only checks isRecord; update the
validator for CounterpartySignature to also type-check optional SigningPubKey
and TxnSignature as strings when present and, if Signers exists, ensure it's an
array whose items are validated with isSigner (same pattern used in
validateBaseTransaction). Locate the CounterpartySignature check and
replace/augment the isRecord-only validation with explicit checks for
SigningPubKey (string), TxnSignature (string), and iterate Signers to call
isSigner on each element, returning a clear failure if any inner check fails.
|
|
||
| import { assert } from 'chai' | ||
| import { decode } from 'ripple-binary-codec' | ||
| import { sign } from 'ripple-keypairs/src' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# First, let's find where ripple-keypairs is located and check its structure
find . -name "ripple-keypairs" -type d | head -20Repository: XRPLF/xrpl.js
Length of output: 83
🏁 Script executed:
#!/bin/bash
# Check if ripple-keypairs is in the packages directory
ls -la packages/ | grep -i keypairRepository: XRPLF/xrpl.js
Length of output: 120
🏁 Script executed:
#!/bin/bash
# Look at the lendingProtocol.test.ts file to see the import
head -10 packages/xrpl/test/integration/transactions/lendingProtocol.test.tsRepository: XRPLF/xrpl.js
Length of output: 324
🏁 Script executed:
#!/bin/bash
# Check the ripple-keypairs package.json to see the entry point
cat packages/ripple-keypairs/package.json | grep -A 5 '"main"\|"exports"'Repository: XRPLF/xrpl.js
Length of output: 169
🏁 Script executed:
#!/bin/bash
# Check what's exported from the ripple-keypairs src/index.ts
cat packages/ripple-keypairs/src/index.tsRepository: XRPLF/xrpl.js
Length of output: 3325
🏁 Script executed:
#!/bin/bash
# Check the structure of ripple-keypairs package
ls -la packages/ripple-keypairs/Repository: XRPLF/xrpl.js
Length of output: 1030
🏁 Script executed:
#!/bin/bash
# Check how other files import from ripple-keypairs
rg "from ['\"]ripple-keypairs" --type typescript --type tsx | head -20Repository: XRPLF/xrpl.js
Length of output: 91
🏁 Script executed:
#!/bin/bash
# Check how other files import from ripple-keypairs
rg "from ['\"]ripple-keypairs" | head -30Repository: XRPLF/xrpl.js
Length of output: 1432
Import from the package entry point instead of /src.
This file is the only one in the codebase importing from 'ripple-keypairs/src'. All other files correctly import from 'ripple-keypairs', which respects the package's public API defined in package.json. Importing directly from /src bypasses the public entry point and can cause issues with bundled or distributed builds where the /src path may not be accessible.
Suggested fix
-import { sign } from 'ripple-keypairs/src'
+import { sign } from 'ripple-keypairs'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { sign } from 'ripple-keypairs/src' | |
| import { sign } from 'ripple-keypairs' |
🤖 Prompt for AI Agents
In `@packages/xrpl/test/integration/transactions/lendingProtocol.test.ts` at line
5, Replace the direct source import of the sign function from
'ripple-keypairs/src' with the package entry point 'ripple-keypairs'; update the
import that currently references 'sign' so it imports from 'ripple-keypairs'
instead, ensuring you use the public package API rather than the internal /src
path (look for the import statement that brings in the sign symbol).
merge main from xrplf
High Level Overview of Change
1, Workflow needs to be triggered from main branch for both beta and stable release
2, For stable release, A PR from release branch to main branch is required before triggering the release pipeline
3, Security champion(Chenna and Cheng) are added to Security reviewers. Beta sec review will be done by Security champion.
4, "-experimental" will automatically appended to dist tag for beta release
5, Only unit test needs to be run for beta release
Context of Change
Type of Change
Did you update HISTORY.md?
Test Plan